package net.hvacapp.cmvrfforandroid.ui.project.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by zhangnorman on 15/7/27.
 */
public class GuidData implements Parcelable {
    private String guidId;
    private String name;
    private String comment;

    private boolean selected;
    private boolean expand; //是否展开的

    private List<GuidData> xsData; //保存型式数据

    public List<GuidData> getXsData() {
        return xsData;
    }

    public void setXsData(List<GuidData> xsData) {
        this.xsData = xsData;
    }


    public boolean isExpand() {
        return expand;
    }

    public void setExpand(boolean expand) {
        this.expand = expand;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGuidId() {
        return guidId;
    }

    public void setGuidId(String guidId) {
        this.guidId = guidId;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    /**
     * Describe the kinds of special objects contained in this Parcelable's
     * marshalled representation.
     *
     * @return a bitmask indicating the set of special object types marshalled
     * by the Parcelable.
     */
    @Override
    public int describeContents() {
        return 0;
    }

    /**
     * Flatten this object in to a Parcel.
     *
     * @param dest  The Parcel in which the object should be written.
     * @param flags Additional flags about how the object should be written.
     *              May be 0 or {@link #PARCELABLE_WRITE_RETURN_VALUE}.
     */
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(guidId);
        dest.writeString(name);
        dest.writeString(comment);
    }

    /**
     * 序列化实体类
     */
    public static final Creator<GuidData> CREATOR = new Creator<GuidData>() {
        public GuidData createFromParcel(Parcel source) {
            GuidData data = new GuidData();
            data.guidId = source.readString();
            data.name = source.readString();
            data.comment = source.readString();

            return data;
        }

        public GuidData[] newArray(int size) {
            return new GuidData[size];
        }
    };

}
